package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.BaiSciMapper;
import com.ruoyi.system.domain.BaiSci;
import com.ruoyi.system.service.IBaiSciService;

/**
 * 每日科普Service业务层处理
 * 
 * @author saruri
 * @date 2024-07-18
 */
@Service
public class BaiSciServiceImpl implements IBaiSciService 
{
    @Autowired
    private BaiSciMapper baiSciMapper;

    /**
     * 查询每日科普
     * 
     * @param id 每日科普主键
     * @return 每日科普
     */
    @Override
    public BaiSci selectBaiSciById(Long id)
    {
        return baiSciMapper.selectBaiSciById(id);
    }

    /**
     * 查询每日科普上一条
     *
     * @param id 每日科普主键
     * @return 每日科普上一条
     */
    @Override
    public BaiSci selectBaiSciPrevById(Long id)
    {
        return baiSciMapper.selectPrevBaiSciById(id);
    }


    /**
     * 查询每日科普下一条
     *
     * @param id 每日科普主键
     * @return 每日科普下一条
     */
    @Override
    public BaiSci selectBaiSciNextById(Long id)
    {
        return baiSciMapper.selectNextBaiSciById(id);
    }


    /**
     * 查询最新每日科普
     *
     * @return 每日科普
     */
    @Override
    public BaiSci selectBaiSciNew()
    {
        return baiSciMapper.selectBaiSciNew();
    }


    /**
     * 查询每日科普列表
     * 
     * @param baiSci 每日科普
     * @return 每日科普
     */
    @Override
    public List<BaiSci> selectBaiSciList(BaiSci baiSci)
    {
        return baiSciMapper.selectBaiSciList(baiSci);
    }

    /**
     * 新增每日科普
     * 
     * @param baiSci 每日科普
     * @return 结果
     */
    @Override
    public int insertBaiSci(BaiSci baiSci)
    {
        baiSci.setCreateTime(DateUtils.getNowDate());
        return baiSciMapper.insertBaiSci(baiSci);
    }

    /**
     * 修改每日科普
     * 
     * @param baiSci 每日科普
     * @return 结果
     */
    @Override
    public int updateBaiSci(BaiSci baiSci)
    {
        return baiSciMapper.updateBaiSci(baiSci);
    }

    /**
     * 批量删除每日科普
     * 
     * @param ids 需要删除的每日科普主键
     * @return 结果
     */
    @Override
    public int deleteBaiSciByIds(Long[] ids)
    {
        return baiSciMapper.deleteBaiSciByIds(ids);
    }

    /**
     * 删除每日科普信息
     * 
     * @param id 每日科普主键
     * @return 结果
     */
    @Override
    public int deleteBaiSciById(Long id)
    {
        return baiSciMapper.deleteBaiSciById(id);
    }
//TAG_START:BaiSci_Top_list

//BaiSci服务实现	
@Override
public List<BaiSci> selectBaiSciListTop(BaiSci baiSci) {
    return baiSciMapper.selectBaiSciListTop(baiSci);
}

//TAG_END:BaiSci_Top_list


}
